package com.huatai.common.entity;

import com.alibaba.ttl.TransmittableThreadLocal;

import java.util.Map;

/**
 * @program: ganghua
 * @description: 解析用户
 * @author: songxiude
 * @create: 2024-09-24 19:41
 **/
public class AuthUserContext {
	private static final TransmittableThreadLocal<UserInfo> CONTEXT = new TransmittableThreadLocal<>();

	public static void setUser(UserInfo user) {
		CONTEXT.set(user);
	}

	public static UserInfo getUser() {
		return CONTEXT.get();
	}

	public static void clear() {
		CONTEXT.remove();
	}

}
